<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Address extends TXT_Controller{

    /**
     * _before 
     * 执行方法前执行
     * 
     * @access protected
     * @return boolean
     */
    protected function _before($method) {

        // 忽略检查登录的方法
        $ignores = array();

        if ($ignores && !in_array($method, $ignores)) {
            $this->_checkLogin();
        }

        return true;
    }

    /**
     * index 
     * 主页索引页(首页)
     * 
     * @access public
     * @return void
     */
    public function index() {

        $data = array(
            'title' => '手机号码本',
            'tpl' => 'address/index',
        );

        $this->_render('base/frame', $data);
    }

    /**
     * addgroup
     * 添加分组
     * @access public
     * @return void
     */ 
    public function addgroup() {
        $this->load->model('customer_group_model');
        $return = $this->customer_group_model->addGroup();
        if($return['result'])  {
            return $this->_ajaxMessage(0);
        } else {
            return $this->_ajaxMessage(1, $return['message']);
        }
        //$this->load->view('base/frame', $data);
    }

    /**
     * editgroup
     * 编辑分组
     *
     * @access public
     * $return void
     */
    public function editgroup($cgid) {

    }

    /**
     * delgroup
     * 删除分组
     *
     * @access public
     * @return void
     */
    public function delgroup($cgid) {
    }
}


